#pragma once

namespace mgfx
{
	typedef int TextureID;

	class Material
	{
	public:
		static Material * create(const std::string & name = "");
		static void createDefault();
		static void freeAll();

		static Material * Default;

		XMCOLOR4F DiffuseColor;
		XMFLOAT2 SpecularIntensityAndPower;

		TextureID DiffuseMap;
		TextureID NormalMap;
		TextureID SpecularMap;

		void initDefault();

	private:
		Material();

		typedef std::map<std::string, Material*> ResourceMap;
		static ResourceMap mResources;

		static uint mNextAutoId;
	};
}